<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div class="t_bar">
	 <span class="color_red">*</span>${param.title }
</div>

<table id="units" class="table01 t_css" border="0" cellspacing="0" cellpadding="0">
	<thead>
		<tr>
			<th width="5%" align="center">选择</th>
			<th width="5%" align="center">序号</th>
			<th width="17%" align="center">单位名称</th>
			<th width="5%" align="center">排名</th>
			<th width="17%" align="center">联系人</th>
			<th width="17%" align="center">联系电话</th>
			<th width="17%" align="center">电子信箱</th>
			<th width="17%" align="center">传真</th>
		</tr>
	</thead>
	<tbody>
		<tr style="display: none">
			<td align="center">
			<input type="radio" name="units_seq" />
			<input type="hidden" name="units|organization[0]|contribution" /> 
			<textarea style="display:none" name="units|organization[0]|contribution"></textarea>
			<input type="hidden" name="units|organization[0]|contribution_hidden"  />
			<input type="hidden" name="units|organization[0]|zip_code"  />
			<input type="hidden" name="units|organization[0]|org_place" />
			<input type="hidden" name="units|organization[0]|nature_name"  />
			<input type="hidden" name="units|organization[0]|nature_value"/>
			<input type="hidden" name="units|organization[0]|address"  />
			<input type="hidden" name="units|organization[0]|enterprise_number" />
			<input type="hidden" name="units|organization[0]|contact_mobile" />
			</td>
			<td align="center"><span name="units|organization[0]@seq_no">[index]</span></td>
			<td align="center"><span name="units|organization[0]|org_name"></span></td>
			<td align="center"><span name="units|organization[0]|rank"></span></td>
			<td align="center"><span name="units|organization[0]|contact_name"></span></td>
			<td align="center"><span name="units|organization[0]|org_tel"></span></td>
			<td align="center"><span name="units|organization[0]|email" ></span></td>
			<td align="center"><span name="units|organization[0]|fax2" ></span></td>
		</tr>
		<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/units/organization" var="situation">
			<c:choose>
				<c:when test="${index<10}">
					<c:set value="0" var="flag" scope="page" />
				</c:when>
				<c:otherwise>
					<c:set value="" var="flag" scope="page" />
				</c:otherwise>
			</c:choose>
			<tr>
				<td align="center"><input type="radio" name="units_seq" />
				<input type="hidden" name="units/organization[${flag}${index}]/zip_code" value="<x:out select="$situation/zip_code" />" />
				<input type="hidden" name="units/organization[${flag}${index}]/address" value="<x:out select="$situation/address" />" />
				<input type="hidden" name="units/organization[${flag}${index}]/org_place" value="<x:out select="$situation/org_place" />" />	
				<input type="hidden" name="units/organization[${flag}${index}]/nature_name" value="<x:out select="$situation/nature_name" />" />
				<input type="hidden" name="units/organization[${flag}${index}]/nature_value" value="<x:out select="$situation/nature_value" />" />
				<input type="hidden" name="units/organization[${flag}${index}]/enterprise_number" value="<x:out select="$situation/enterprise_number" />" />
				<input type="hidden" name="units/organization[${flag}${index}]/contact_mobile" value="<x:out select="$situation/contact_mobile" />" />
				<input type="hidden" name="units/organization[${flag}${index}]/contribution" value="<x:out select="$situation/contribution" />" />
				<textarea style="display:none" name="units/organization[${flag}${index}]/contribution"><x:out select="$situation/contribution"/></textarea>
				<input type="hidden" name="units/organization[${flag}${index}]/contribution_hidden" value="<x:out select="$situation/contribution_hidden" />" />
				</td>
				<td align="center">
					<span name="units/organization[${flag}${index}]@seq_no">${index+1}</span>
				</td>
				<td align="center">
					<span name="units/organization[${flag}${index}]/org_name"><x:out select="$situation/org_name" /></span>
				</td>
				<td align="center">
					<span name="units/organization[${flag}${index}]/rank"><x:out select="$situation/rank" /></span>
				</td>
				<td align="center">
					<span name="units/organization[${flag}${index}]/contact_name"><x:out select="$situation/contact_name" /></span>
				</td>
				<td align="center">
					<span name="units/organization[${flag}${index}]/org_tel"><x:out select="$situation/org_tel" /></span>
				</td>
				<td align="center">
					<span name="units/organization[${flag}${index}]/email"><x:out select="$situation/email" /></span>
				</td>
				<td align="center">
					<span name="units/organization[${flag}${index}]/fax2"><x:out select="$situation/fax2" /></span>
				</td>
					
			</tr>
			<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>

	</tbody>

</table>

<br />
<table border="0" cellpadding="0" cellspacing="1">
	<tr>
		<td ><input class="button_02" type="button" value="添加"
			onclick="if(checkTabLimit('units',${param.num },'候选单位情况最多只能填写${param.num }条')){addNewRow('units','${ctx}/proposal/2014/edit/dialog/psnInfoEdit_zjk_hxdw?parentTab=units&type=add&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','添加候选单位');}try{top.resizeFrame();}catch(e){};" />
			<input class="button_02" id="prev_org" type="button" value="上移" onclick="movePrev('units');" />
			<input class="button_02" id="next_org" type="button" value="下移" onclick="moveNext('units');" />
			<input class="button_02" id="zh_psnEdit" type="button" value="编辑"
			onclick="editRow('units','${ctx}/proposal/2014/edit/dialog/psnInfoEdit_zjk_hxdw?parentTab=units&type=edit&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','编辑候选单位')">
			<input class="button_02" id="del_org" type="button" value="删除"
			onclick="deleteSelectedRow('units','候选单位');" /></td>
	</tr>
</table>




<script type="text/javascript">
/*  $(document).ready(function(){
  	$("#units").each(function(){
  		$(this).find("tr:even").addClass("li_1");
  		$(this).find("tr:odd").addClass("li_2");
  	});
  }); */
  
/*  $(document).ready(function(){
	showTable1();
	showOrgName();
})

function showTable1(){
	var text= $("#units").find("tr:last").find("span[name$='@seq_no']").text();
	   text = parseInt(text);
	   if (text >= 2){
		   $("#text2").show();
	   }else{
		   $("#text2").hide();
		   }
}



function showOrgName(){
	var i = 0;
	var t = 0;
	var OrgName="";
	for(i;i <= 10;i++){
		var OrgNameSmall="";
		if(i<=9){
			i="0" +i;
		}
		if(t==0){OrgNameSmall=$("span[name='units/organization["+i+"]/org_name']").text();}
		
		if($("span[name='units/organization["+i+"]/org_name']").text() != "" && $("span[name='units/organization["+i+"]/org_name']").text() != null)
		{
			if(t>0){OrgNameSmall= "、" + $("span[name='units/organization["+i+"]/org_name']").text();}
		}
		OrgName=OrgName + OrgNameSmall;
	
		$("#main_finish_org").text(OrgName);
		
		t++;
	}
} 
 */

</script>
<%-- <div id="text2" style="display: none">
<div class="t_bar"><span class="color_red">*</span>对本项目技术创新和应用推广的贡献（限300字）</div>
<table class="t_css" width="100%" border="0" cellpadding="0" id="uint_cooperation_introduction" cellspacing="1" style="table-layout:fixed;">
	<col width="20%;"/>
	<col width="25%;"/>
	<col width="20%;"/>
	<col width="20%;"/>
	<col width="25%;"/>
	<tr class="li_2">
		<td  colspan="5" >
			<textarea rows="10" style="width: 888px;" name='units/organization/contribution' class="input_textarea required maxlength:300"   label="对本项目技术创新和应用推广的贡献"><x:out select="$xmlData/data/units/organization/contribution"/></textarea>
	      <input type='hidden' name='units/organization/contribution_hidden' id='contribution_hidden' value=''>
		</td>
	</tr>
</table>
</div>  --%>
